package com.tongda.core.enums;

public enum TrueFalseEnum {
	FALSE("0", "否"), TRUE("1", "是");

	public final static String enumCode = "TrueFalse";
	public final static String enumName = "是否";
	private String code;
	private String desc;

	TrueFalseEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static String getDesc(String code) {
		for (TrueFalseEnum status : TrueFalseEnum.values()) {
			if (status.getCode().equalsIgnoreCase(code)) {
				return status.getDesc();
			}
		}
		return "未知";
	}

	public static String getCode(String desc) {
		for (TrueFalseEnum status : TrueFalseEnum.values()) {
			if (status.getDesc().equalsIgnoreCase(desc)) {
				return status.getCode();
			}
		}
		return FALSE.getCode();
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

}
